package com.qf.java2201.mapper;

import com.qf.java2201.pojo.Kind;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.qf.java2201.vo.BarVo;
import org.apache.ibatis.annotations.*;

public interface KindMapper {
    List<Kind> selectByParams(Map<String, Object> params);

    @Options(useGeneratedKeys = true, keyProperty = "id") // 自增key，回显主键为id
    @Insert("insert into kind values(null,#{fl_name},#{fl_kind_picture},#{create_time},null )")
    int addFlowerKind(Kind kind);

    @Options(useGeneratedKeys = true, keyProperty = "id") // 自增key，回显主键为id
    @Delete("delete from kind where id = #{id}")
    int deleteFlower(int id);

    @Options(useGeneratedKeys = true, keyProperty = "id") // 自增key，回显主键为id
    @Update("update kind set fl_name = #{fl_name} ,fl_kind_picture = #{fl_kind_picture} ,create_time = #{create_time}where id = #{id}")
    int updateFlower(Kind kind);

    List<Kind> flowerPageData(Kind kind);

    @Select("SELECT COUNT(*) as count_time,create_time FROM kind group by create_time")
    List<BarVo> dateBarData();

    List<Kind> selectList(Kind kind);

    int deleteByIds(ArrayList<Integer> list);
}